<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<div>
  <a th:href="@{/commodity/toadd}">添加</a>
<table border="1px">
  <tr>
    <td>商品ID</td>
    <td>商品名称</td>
    <td>价格</td>
    <td>创建时间</td>
    <td>是否上下架</td>
    <td>当前状态</td>
    <td>是否启用</td>
    <td>操作</td>
  </tr>
  <tr th:each="all : ${list}">
    <td th:text="${all.pid}"></td>
    <td th:text="${all.pname}"></td>
    <td th:text="${all.price}"></td>
    <td th:text="${#dates.format(all.createdTime,'yyyy-MM-dd')}"></td>
    <td th:text="${all.putaway}=='0' ? '上架':'下架'"></td>
    <td th:text="${all.status}=='0' ? '草稿':'提交'"></td>
    <td th:text="${all.enable}=='0' ? '启用':'不启用'"></td>
    <td>
      <a th:href="@{/commodity/add1(status=${all.status})}">是否启用</a>
      <a href="">修改</a>
      <a th:href="@{/commodity/del(pid=${all.pid})}">删除</a>
    </td>
  </tr>
</table>
</div>
</body>
</html>
